package com.spring.demo.untils.document;

import com.alibaba.fastjson.JSON;
import com.spring.demo.untils.document.handle.conventer.ClassMeta;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * @author xuweizhi
 * @since 2023/06/20 11:46
 */
public class JsonMapping {


    public static String handle(String line, List<ClassMeta> list) {
        String[] split = line.split("\t");
        Map<Object, Object> objectObjectMap = new HashMap<>();
        for (ClassMeta classMeta : list) {
            objectObjectMap.put(classMeta.getName(), split[classMeta.getIndex()]);
        }
        return JSON.toJSONString(objectObjectMap);
    }

}
